package com.ruoyi.order.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.order.BO.GoodsOrderFinishMsgBO;
import com.ruoyi.order.domain.Order;
import com.ruoyi.order.VO.OrderVO;

import java.util.List;

/**
 * 订单Mapper接口
 *
 * @author HHAOYU
 * @date 2020-12-14
 */
public interface OrderMapper extends BaseMapper<Order> {
    /**
     * 查询订单
     *
     * @param id 订单ID
     * @return 订单
     */
    public Order selectOrderById(Long id);

    public Order selectOrderByYzOrderId(String yzOrderId);

    public OrderVO selectOrderForApiById(Order order);

    public List<OrderVO> selectOrderForApi(Order order);

    public List<OrderVO> selectOrderForApiV2(Long[] ids);

    public List<Order> selectOrderListPre(Order order);

    /**
     * 查询订单列表
     *
     * @param order 订单
     * @return 订单集合
     */
    public List<Order> selectOrderList(Order order);


    /**
     * 新增订单
     *
     * @param order 订单
     * @return 结果
     */
    public int insertOrder(Order order);

    /**
     * 修改订单
     *
     * @param order 订单
     * @return 结果
     */
    public int updateOrder(Order order);

    /**
     * 删除订单
     *
     * @param id 订单ID
     * @return 结果
     */
    public int deleteOrderById(Long id);

    /**
     * 批量删除订单
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteOrderByIds(Long[] ids);

    public GoodsOrderFinishMsgBO selectGOMsgBO(Long id);

    public List<Order> selectOrderAllList(Order order);

    public int  updateOptimisticLock(Order order);
}
